<admintpl file="header" />
<style>
a{cursor: pointer;}
.fl{float:left;}
.c-pages{padding:20px 0; text-align: center;}
.c-pages.tl{text-align: left;}
.c-pages span{display: inline-block; margin-right: 5px; font-size:12px; height:28px; line-height: 28px;}
.c-pages span.col{color: #fe344e; font-weight: 600;}
.c-pages span a{display: inline-block; margin:0 3px; height:28px; line-height: 28px; text-align: center; padding:0 12px; border:1px solid #ccc; text-decoration: none; border-radius: 2px;}
.c-pages span a:link,.c-pages span a:active,.c-pages span a:visited{color: #333;}
.c-pages span a:hover{ color: #ff8540; }
.c-pages span a.active{color: #fff; background: #ff8540;}
.c-pages  .current{ color: #fff; background: #ff8540; display: inline-block; margin: 0 3px; height: 28px;
	line-height: 28px;
	text-align: center;
	padding: 0 12px;
	text-decoration: none;
	border-radius: 2px;
}
.addWei{background: none; border:1px solid #ff8540; color: #ff8540; padding:4px 6px; font-size: 14px;float:left;margin-left:80px;margin-top:4px;}
.btns{background: none; border:1px solid #ff8540; color: #ff8540; padding:4px 6px; font-size: 14px;margin-top:5px;margin-left: 33px;}
.btnfx{cursor: pointer; width:60px; height:28px;line-height:28px; border:1px solid #07a9ff; color: #07a9ff; border-radius: 4px; background: none; margin-left:4px;}
.table td,.table th{text-align:center;}
.fx_table2 tr{white-space:nowrap;  overflow: hidden;}
</style>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
    <form class="well form-search" method="post" action="{:U('Zhiding/tuijian_zhiding_lst')}">
        会员昵称：<input type="text" style="width:120px;height: 15px;margin-right: 20px" value="{$nickname}" name="nickname" id="nickname" placeholder="请输入昵称">
        手机号： <input type="number" style="width:170px;height: 15px;margin-right: 20px" value="{$phone}" name="phone" id="phone" placeholder="请输入手机号">
        <input type="submit" style="margin-top:5px; padding:4px 12px;" class="btn btn-danger btnc1" value="搜索"/>
        <a class="btn btn-primary btnc2" style="padding:4px 12px; margin-top:5px; " href="{:U('Zhiding/tuijian_zhiding_lst')}">清空</a>
    </form>

    <div id="mydiv">
        <table class="fx_table2 table table-hover table-bordered">
            <thead>
            <tr>
                <th  style="text-align: center">序号</th>
                <th  style="text-align: center">排序</th>
                <th  style="text-align: center">昵称</th>
                <th  style="text-align: center">手机号</th>
                <th  style="text-align: center">推荐图片</th>
                <th  style="text-align: center">职业属性</th>
                <th  style="text-align: center">创建时间</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="data" item="v" key='k'>
                <tr>
                    <td  style="text-align: center">{$k+1+$sd}</td>
                    <td  style="text-align: center"><input name="paixu" id="paixu1" value="{$v.is_paixu}"  type="number" min="0" max="5" style="width: 35px"><input type="button" data-id="{$v.id}" class="btn  btn-primary paixu"  value="排序"  style="margin-left: 20px;"></td>
                    <td  style="text-align: center"><?php if($v['nickname']){echo $v['nickname'];}else{echo "—";} ?></td>
                    <td  style="text-align: center">{$v.phone}</td>
                    <td  style="text-align: center"><img src="{$v.tuijian_img}" style="width: 50px;height: 50px"></td>
                    <td  style="text-align: center">{$v.lable}</td>
                    <td  style="text-align: center"><?php echo date("Y-m-d",$v["ctime"]);?></td>
                    <!--<td  style="text-align: center"> <a name="status" onclick="kaiguan({$v.id})">-->
                        <!--<?php if($v["is_zhiding"] == '0'){echo "置顶";}else{echo "取消置顶";}; ?>-->
                    <!--</a></td>-->
                </tr>
            </foreach>
            </tbody>
        </table>
    </div>
   <div class="c-pages tc">
		<span>{$page} 第{$p}页/共{$totalpage}页</span>
	</div>
</div>
</body>
</html>
<script src="public/js/laydate/laydate.js"></script>

<script type="text/javascript" src="__PUBLIC__/js/layer/layer.js"></script>
<script >
//    function kaiguan(id){
//        window.location.href = 'index.php?g=Admin&m=Zhiding&a=tuijian_kaiguan_change&id='+id;
//    }

$(".paixu").click(function() {
    var id = $(this).data("id");
    var tuijian = $(this).siblings("input[name='paixu']").val();
    if(tuijian==""){
        alert("输入的顺序不能为空");
        return false;
    }
    $.ajax({
        type: "POST",
        url: "{:U('Zhiding/paixu2')}",
        data: {'id':id,'tuijian': tuijian},
        success: function (dat) {
            if(dat==1){
                alert("排序成功");
                window.location.href="";
            }
        }
    });
});


laydate({
    elem: '#test1',
    format: 'YYYY-MM-DD', // 分隔符可以任意定义，该例子表示只显示年月
    start: laydate.now(0, 'YYYY-MM-DD'),
    festival: true, //显示节日
    choose: function(datas){ //选择日期完毕的回调
        $("#test1").html(datas);
        //	window.location.href='index.php?g=Admin&m=Count&a=caigou&time='+datas+'&shop='+sid+'&time_type='+1;
    }
});

laydate({
    elem: '#test2',
    format: 'YYYY-MM-DD', // 分隔符可以任意定义，该例子表示只显示年月
    start: laydate.now(0, 'YYYY-MM-DD'),
    festival: true, //显示节日
    choose: function(datas){ //选择日期完毕的回调
        $("#test2").html(datas);
        //	window.location.href='index.php?g=Admin&m=Count&a=caigou&time='+datas+'&shop='+sid+'&time_type='+1;
    }
});
$(function(){
	$(".well").width($(".fx_table2").width()-38);
})



</script>
